package priv.mill.config;

import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import priv.mill.model.User;
@Component
public class String2UserConver  implements Converter<String, User>{

	
	//张三： ：adfaaisjd::8
	@Override
	public User convert(String arg0) {
		String[] args = arg0.split("::");
		User user = new User();
		user.setName(args[0]);
		user.setPassword(args[1]);
		user.setUserId(Integer.valueOf(args[2]));
		
		return user;
	}
	
}
